import axios from 'axios'

import request from '@/utils/request'
// 获取表格,查
export function getSubjectApi(params) {
  return axios({
    url: '/mock/content/subject',
    method: 'get',
    params
  })
}
// 获取学科
export function getAllSubjectApi() {
  return axios({
    url: '/mock/content/allSubject',
    method: 'get'
  })
}
// 增
export function addSubjectApi(data) {
  return axios({
    url: '/mock/content/subject',
    method: 'post',
    data
  })
}
// 回显
export function editSubjectApi(params) {
  return axios({
    url: '/mock/content/subject',
    method: 'get',
    params
  })
}
// 修改
export function updataSubjectApi(data) {
  return axios({
    url: '/mock/content/subject',
    method: 'put',
    data
  })
}
// 删除
export function delSubjectApi(params) {
  return axios({
    url: '/mock/content/subject',
    method: 'delete',
    params
  })
}

// 上传图片
export const uploadImage = (data) => {
  return request({
    url: 'index/upload?mode=single&type=image',
    data,
    method: 'post'
  })
}
